﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<UFPC.Models.Order>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Details</h2>

    <fieldset>
        <legend>Fields</legend>

        <table class="formtable">
            <tr>
                <td class="formfield">OrderId :</td>
                <td><%= Html.Encode(Model.OrderId) %></td>
            </tr>
            <tr>
                <td class="formfield">Customer :</td>
                <td><%= Html.Encode(Model.Customer.Name) %></td>
            </tr>
            <tr>
                <td class="formfield">Order Date :</td>
                <td><%= Html.Encode(Model.OrderDate) %></td>
            </tr>
            <tr>
                <td class="formfield">Comments :</td>
                <td><%= Html.Encode(Model.Comments) %></td>
            </tr>
        </table>

        <fieldset >
            <legend>Order Details</legend>

            <div>
                <table>
                    <tr>
                        <th>Action</th>
                        <th>Product</th>
                        <th>Quantity</th>
                    </tr>

                    <% foreach (var item in Model.OrderDetails) { %>
                        <tr>
                            <td>
                                <!--%= Html.ActionLink("Edit", "Edit", new { id=item.OrderId }) %--> |
                                <!--%= Html.ActionLink("Delete", "Delete", new { id=item.OrderId })%-->
                            </td>
                            <td>
                                <%= Html.Encode(item.Products.Name) %>
                            </td>
                            <td>
                                <%= Html.Encode(item.Quantity) %>
                            </td>
                        </tr>
                    <% } %>
                </table>
            </div>
        </fieldset>

        
    </fieldset>
    <p>
        <!--%= Html.ActionLink("Edit", "Edit", new { id=Model.OrderId }) %> |-->
        <%= Html.ActionLink("Back to List", "Index") %>
    </p>

</asp:Content>

